#include "input.h"

void Input::BeginFrame()
{
	this->PressedKeys.clear();
	this->ReleasedKeys.clear();
}

void Input::KeyDownEvent(const SDL_Event &Event)
{
	this->PressedKeys[Event.key.keysym.scancode] = true;
	this->HeldKeys[Event.key.keysym.scancode] = true;
}

void Input::KeyUpEvent(const SDL_Event &Event)
{
	this->ReleasedKeys[Event.key.keysym.scancode] = true;
	this->HeldKeys[Event.key.keysym.scancode] = false;
}

bool Input::WasKeyPressed(SDL_Scancode Key)
{
	return this->PressedKeys[Key];
}

bool Input::WasKeyReleased(SDL_Scancode Key)
{
	return this->ReleasedKeys[Key];
}

bool Input::IsKeyHeld(SDL_Scancode Key)
{
	return this->HeldKeys[Key];
}